<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>登录</title>
    <meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1, minimum-scale=1">
    <link rel="stylesheet" href="css/login.css">
    <script type="text/javascript" src="js/rem.js"></script>
    <script type="text/javascript" src="js/jquery-2.1.1.min.js"></script>
    <script type="text/javascript" src="js/layer/mobile/layer.js"></script>
    <script type="text/javascript" src="js/initjs.js"></script>
</head>

<body class="login">
    <div class="content">
        <h1>登录</h1>
        <form action="" method="post">
            <div class="row">
                <input type="text" require placeholder="用户名" maxlength="11" id="phone" autocomplete="off" />
                <div class="icon"><img src="./images/new/icon1.png"></div>
            </div>
            <div class="row">
                <input type="password" require placeholder="密码" maxlength="20" id="password" autocomplete="off" />
                <div class="icon"><img src="./images/new/icon2.png"></div>
            </div>
            <!--<input class="submit" type="button" value="登录"/>-->
            <button class="submit" type="button">登录</button>
        </form>
    </div>
<script type="text/javascript">

$(function() {
	$(".submit").click(function() {
        var param={};
        param.username = $.trim($("#phone").val());
        param.password = $.trim($("#password").val());
        $.post(serverPath+'/admin/api/login', param,function(result) {
            if(result.ret==0){
                window.location.href = serverPath+'/static/h5/makerOrder.html'
            }else{
                layer.open({
                    content: result.msg
                    ,skin: 'msg'
                    ,time: 2 //2秒后自动关闭
                });
            }
        });
	});
});
</script>
</body>
</html>